Optimal. Leaf size=46 \[ \frac {2 \sin (c+d x)}{a^2 d}+\frac {2 i \cos (c+d x)}{a^2 d}-\frac {\tanh ^{-1}(\sin (c+d x))}{a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3092, 3090, 2637, 2638, 2592, 321, 206} \[ \frac {2 \sin (c+d x)}{a^2 d}+\frac {2 i \cos (c+d x)}{a^2 d}-\frac {\tanh ^{-1}(\sin (c+d x))}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 321
Rule 2592
Rule 2637
Rule 2638
Rule 3090
Rule 3092
Rubi steps
\begin {align*} \int \frac {\sec (c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx &=-\frac {\int \sec (c+d x) (i a \cos (c+d x)+a \sin (c+d x))^2 \, dx}{a^4}\\ &=-\frac {\int \left (-a^2 \cos (c+d x)+2 i a^2 \sin (c+d x)+a^2 \sin (c+d x) \tan (c+d x)\right ) \, dx}{a^4}\\ &=-\frac {(2 i) \int \sin (c+d x) \, dx}{a^2}+\frac {\int \cos (c+d x) \, dx}{a^2}-\frac {\int \sin (c+d x) \tan (c+d x) \, dx}{a^2}\\ &=\frac {2 i \cos (c+d x)}{a^2 d}+\frac {\sin (c+d x)}{a^2 d}-\frac {\operatorname {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^2 d}\\ &=\frac {2 i \cos (c+d x)}{a^2 d}+\frac {2 \sin (c+d x)}{a^2 d}-\frac {\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{a^2 d}\\ &=-\frac {\tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {2 i \cos (c+d x)}{a^2 d}+\frac {2 \sin (c+d x)}{a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.24, size = 184, normalized size = 4.00 \[ -\frac {\sec ^2(c+d x) \left (\cos \left (\frac {3}{2} (c+d x)\right )+i \sin \left (\frac {3}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 i\right )+\sin \left (\frac {1}{2} (c+d x)\right ) \left (i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-i \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2\right )\right )}{a^2 d (\tan (c+d x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 64, normalized size = 1.39 \[ -\frac {{\left (e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 2 i\right )} e^{\left (-i \, d x - i \, c\right )}}{a^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.68, size = 57, normalized size = 1.24 \[ -\frac {\frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} - \frac {4}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.23, size = 63, normalized size = 1.37 \[ \frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2} d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2} d}+\frac {4}{a^{2} d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-i\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.43, size = 117, normalized size = 2.54 \[ -\frac {-2 i \, \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - 2 i \, \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) - 4 i \, \cos \left (d x + c\right ) + \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) - 4 \, \sin \left (d x + c\right )}{2 \, a^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.67, size = 44, normalized size = 0.96 \[ -\frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}+\frac {4{}\mathrm {i}}{a^2\,d\,\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\sec {\left (c + d x \right )}}{- \sin ^{2}{\left (c + d x \right )} + 2 i \sin {\left (c + d x \right )} \cos {\left (c + d x \right )} + \cos ^{2}{\left (c + d x \right )}}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________